[ambient noise]
My car knows when it’s wet.
That’s right, it’s got automatic windshield wipers.
When they’re set to automatic, and the car gets wet, they wipe.
How it know that?
It’s actually really simple.
If you look at the windshield,
you’ll notice an area near the top center which is black.
And if you look closelier you’ll see the component the car uses to determine windshield wetness.
Oh, the camera?
No, it's not the camera - that’d be silly!
Then you’d have to devote some precious clock cycles away from the already wildly complicated computer vision tasks
which help keep the car centered in its lane.
That seems like a weird decision
and I don’t even know how well that could possibly work no matter how many software updates you throw at it.
No, I’m not alluding to anything specific, why on Earth would you think that?
Right above that camera which looks forward at the road you’ll see a little circular spot with some spots within the spot and that, viewers,
is the rain sensor.
Look, I get it wet - and the car wipes!
But two can play at that game.
You may think this is wildly complicated and expensive technology
but actually it’s just two of the simplest electronic components you can imagine working together in a very clever way.
Below the dark portions of the rain sensor are infrared LEDs shining light up into the glass,
and adjacent to them are photodiodes which detect that light.
Now, that bright spot at the bottom?
That’s not actually part of the rain sensor.
It’s an ambient light sensor used to control the car’s headlights automatically.
The two components just live in the same assembly.
The parts that make up the rain sensor aren’t really visible
because they’re below a filter which blocks visible light and thus it appears black to our eyes.
That’s strange, didn’t we just encounter that with stovetops?
Weird connections happening lately.
To demonstrate how that detects rain, I’ll use a piece of glass and a laser pointer.
If I shine the laser up at the glass at about a 45 degree angle,
you’ll notice that a spot of laser light is reflected back down towards the table.
I’ll put a piece of paper there to make it more visible.
Now watch what happens when I get the glass wet.
Not a whole lot.
That’s a bummer.
Ah, but this isn’t actually an accurate demonstration of the principles involved in the rain sensor.
Rather than look at the light reflected back downward by the glass,
let’s look at the spot produced above the glass by the laser light which makes it through.
Now watch closely.
Did you see that? It moved.
That happened because the water on top of the glass changed the angle of refraction as light left the glass.
Now, like some politicians, I’m really not really good at the whole optics thing
so I’m not getting too deep into the weeds here.
But as light passes from one medium to another, its speed actually changes
and because of… reasons that means it appears to change direction.
That concept is known as refraction.
And the refraction index of water is different from that of air.
That means the change in speed and thus change in refraction angle is different between light passing from glass into air and light passing from glass into water.
The rain sensor, though, is entirely under the glass
so it’s not as if it can directly detect that change.
Instead, it leverages the effect of total internal reflection.
If you’ve ever gone swimming in a pool with goggles on and looked up at the surface of the water while submerged,
you may have noticed that it looks like a mirror from shallow angles.
Here’s some stock footage to illustrate.
That’s total internal reflection at work - the water directly above you transmits light just fine and you can see through it,
but there’s a critical angle at which the air-water interface will reflect all light back down
and since it’s smooth like glass, it looks like a mirror.
So now - how can the rain sensor take advantage of that?
Well, first, since the module isn’t part of the glass,
we need an optical interface material to couple the sensor to the glass and remove the air-to-glass optical interface on the bottom.
That takes the form of a sticky gel which, now that it’s in-place, you can’t see.
Which, really, is the point - when it’s doing its job,
the sensor and the glass become one
(from an optical perspective).
Now the key is that the infrared LEDs that we talked about earlier
are shining up at the glass just shallow of the critical angle of total internal reflection.
So, all the light they produce will simply bounce off the top surface of the the glass and head back downward.
And, at the other end of that beam of light, is a photodiode.
That will then detect the light being generated by the LED.
And to make sure it’s detecting that light and not something else,
the LEDs are actually rapidly blinking and the photodiode is looking for that pattern of blinks.
That’s a simpler way of saying the LEDs are producing a specific modulated signal that the photodiode is tuned to detect.
But because the angle between the photodiode and the LED is so close to the critical angle of total internal reflection,
if conditions should change the intensity of that signal being received by the photodiode will also change.
What condition?
Condition wet.
Water on the glass, as we saw in the earlier demo, changes the refraction angle because its refractive index is different from air.
And it will change it just enough to break the effect of total internal reflection.
Wet glass will allow some of the light produced by the LEDs to actually escape and be transmitted through to the outside surface.
Which in turn means there’s less light bouncing down to the photodiode to be detected,
so the signal it was receiving begins to diminish.
And, with a little logic circuitry and programming, you can use that loss of signal as a measurement of windshield wetness.
And honestly… that’s it!
It’s that simple.
The sensor starts to see the signal from the LED drop out so it says to the windshield wiper motor -
wipe.
And the wetter the glass, the more the signal drops, so the more it wipes.
And you’ll notice the sensor is deliberately placed in the path of the windshield wipers so they clear the glass with every wipe.
That allows the logic to get some sense of how hard it might be raining based on how quickly the signal drops out after every wiping event.
The only other complexity here is calibration.
Every time the sensor powers up, it’s got to pick a baseline signal level which it deems “dry.”
Yet, if you are out and about in the rain and you turn your car on with the windshield already wet,
it’s going to start out with some lower signal level than typical.
So, somebody smarter than me probably established a minimum signal dropout level which always causes a wipe,
and in fact I’m certain I’ve encountered the car do a single wipe after turning it on
when it didn’t really need to.
But then it can reset its calibration after that wiping event.
And, there’s another trick up its sleeve, and it's my very favorite one:
having two of them.
There are actually two sensor assemblies under here.
You can barely make out the infrared light in this smartphone camera footage.
You'll see there's two spots.
If the windshield is dry, the two sensors should see very similar signals
but if there’s even just a tiny bit of water on top of one of them, or differing amounts between the two,
then the two signals will be very different and it will know immediately that the windshield is wet.
Which calibration method is it actually using?
I do not know.
And if you’ve never lived with a car with automatic wipers, you may wish to know they are great but not exactly perfect.
You are afforded a sensitivity adjustment on the wiper stalk, so you can fine-tune its behavior to your liking.
But while the wipers pretty much always come on when they need to,
sometimes they go absolutely nuts when it’s barely raining or they get a little lazy in a sudden downpour.
Lucky for me, if that happens all I have to do is just slap this stalk which is right next to my hand on the steering wheel
and the wipers will come on full-steam!
Handy user interface, those stalks.
They’re always there and muscle memory takes over!
I’m pro-stalks, is what I’m saying. It’s a good idea.
What’s less of a good idea, though, is the Konami-code like trick I had to look up just to change my car’s wiper blades.
The hood blocks you from lifting the wiper arms so you need them to stop in the up position in order to change them.
and despite digging through all the settings menus I couldn’t find a “change wipers” option.
So I tried just switching the car off with the wipers in the up position, y'know just time it right, using the power button,
but it outsmarted me and parked them anyway.
It turns out what you have to do is turn the car off and then hold the wiper stalk up in the mist position for a few moments
and then the car will do this.
Is this procedure in the owner’s manual?
Yes, but who looks there for information?
I usually like to end my videos with something akin to a moral.
In that vein, the first lesson today is for me
and that is to read the freaking manual!
There’s even an index in here and finding the appropriate information would have taken me mere moments.
People worked hard on this thing and I just… completely ignored it!
So don’t ignore the manuals in your life.
And the second moral is…
don’t ignore what you can do with a few simple components.
Software isn’t everything.
That’s not directed at any organization in particular, mind you.
Just something to keep in mind.
Did I get to 10 minutes yet?
♫ internally smooth jazz ♫
Thanks, by the way, to Jason, a supporter on Patreon, for recommending this video topic.
That happened a long time ago and I’m pretty certain at least one other person has suggested this in the meantime
so if I forgot who you were, I’m sorry.
There’s just too many bimetallic strips getting in the way.
That’s right, it’s got automatic… the thing didn’t start.
You’ll notice that the spot of laser light is re… oh.
…conditions should change, the intensity of a-
Ooh, I needed a comma for my sake
...critical angle of total internal reflection
[annoyance at outside noise]
...it’s got to pick a baseline signal lever.
Signal.
Level.
...had to look, oh yeah I forgo ohyeahIgottagetthething!
You mean to say all you need is an LED, a photodiode, and a bit of adhesive to take the task of detecting rain away from a sophisticated computer vision system?
And that this was a technology available back in the nineties?
That sounds unpossible, I mean if there were a better way to do things, surely it would only come from the halls of one particular company and not anyone else.
This section is usually for puns but today I chose vicious sarcasm.
Not directed at any particular organization, of course :)